<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_info', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('order_id')->index()->comment('订单id');
            $table->unsignedInteger('category_id')->nullable()->comment('分类id');
            $table->decimal('price', 10, 2)->default(0.00)->comment('价格');
            $table->decimal('weight', 10, 2)->default(0.00)->comment('重量');
            $table->string('volume')->nullable()->comment('体积');
            $table->string('calculation')->default(3)->comment('计算方式1.重量2.体积3.计件');
            $table->decimal('courier_money', 10, 2)->default(0.00)->comment('快递员费用');
            $table->decimal('service_money', 10, 2)->default(0.00)->comment('服务站费用');
            $table->decimal('express_money', 10, 2)->default(0.00)->comment('物流公司费用');
            $table->decimal('pack_money', 10, 2)->default(0.00)->comment('包装费用');
            $table->decimal('platform_money', 10, 2)->default(0.00)->comment('平台费用');
            $table->string('actual_weight')->nullable()->comment('');
            $table->string('region_mark')->nullable()->comment('备注');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_info');
    }
}
